﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace _06_委托_必要性2
{
    public delegate void SetButtonEnableDelegate(bool enable);
    public partial class Form1 : Form
    {
        public static SetButtonEnableDelegate SetButton = null;

        public Form1()
        {
            InitializeComponent();
            SetButton = new SetButtonEnableDelegate(SetButtonEnable);
        }

        public void SetButtonEnable(bool enable)
        {
            this.button1.Enabled = enable;
        }

        private void button1_Click(object sender, EventArgs e)
        {
            new Form2().Show();
        }
    }
}
